import {
  Column,
  PrimaryGeneratedColumn,
  CreateDateColumn
} from 'typeorm'
import { EntityModel } from '@midwayjs/orm'

@EntityModel('ie_sms')
export class Sms {

  @PrimaryGeneratedColumn()
  id: number;

  @Column({
    comment: '手机号',
    type: 'varchar',
    length: 15,
    unique: true
  })
  phone: string;

  @Column({
    comment: '验证码',
    type: 'varchar',
    length: 10
  })
  code: string;

  @Column({
    comment: '验证码有效期',
    type: 'timestamp'
  })
  expire_at: Date;

  @CreateDateColumn({
    comment: '创建时间'
  })
  create_at: Date;
}
